MANAGING MEMORY   Random Access Memory (RAM), often known simply as memory, stores data independently of any disk drive. It acts as a temporary store for the system, documents and applications. If there’s a crash or power failure its contents are lost. Memory Operation qqqqqqqqqqqqqq Memory Demands wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww About this Macintosh (in the Finder) shows how much RAM is fitted. If Total Memory appears twice as big as Built-in Memory you’re probably using RAM Doubler! The amount of memory needed by the machine depends on the size of the Mac’s system and on the size and number of applications in use. The following table provides useful guidelines:- System Minimum RAM Workable RAM Typical System RAM 6 1 M 2 M 500 K 7.0 2 M 4 M 1.5 M 7.5 4 M 8 M 2 M · A Power Mac needs at least 16 M to use QuickDraw GX and PowerTalk. A typical application will use between 500 K and 2 M, or much more! The memory used by an open document is dependent on its size. The following table gives a rough guide to how many kilobytes are needed to represent text, using an average of 6 letters per word:- K Words K Words 1 170 30 5000 3 500 50 8500 6 1000 60 10000 10 1700 75 12500 15 2500 100 17000 Actual text documents are usually slightly larger, depending on file type. A graphics file can often use huge amounts of memory. For example, a black and white image covering a standard A4 page uses about 1 M. This rises to 8 M for 8-bit colour or to 23 M for 24-bit colour. These figures can be doubled again if the graphics application has an Undo feature! Allocating Memory to an Application wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww The memory allocation for an application is set within the application itself. To change the allocation you must quit the application, select its icon in the Finder and choose Get Info. You can then see its memory allocation, as shown in the example below:-   The Suggested size is the amount of memory advised by the maker of the application — it can’t be changed from within the window. When the application is launched it tries to use the Preferred size. If this isn’t possible, it uses any available memory in the range between its Minimum size and the Preferred size. Minimum size is often slightly smaller than the Suggested size — if you set it too low you may suffer from crashes. The smallest change you can make to these settings is 16 K. · Some applications use system memory for their data, which means you don’t need to adjust their memory space to accommodate large files — in fact it could make it worse! · If you change any settings it’s worth noting down the original values so that you can restore them back to normal at a later date. Memory Heaps wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww The Mac’s memory is in two heaps. The system heap starts at low addresses and automatically works upwards whilst the application heap starts at the top and works down. System 7 is designed to prevent the two from colliding! The first application you open is put at the top of the application heap and subsequent programs fill the space beneath. The amount of space available is shown in the About this Macintosh window — exact figures for each application are given via Balloon Help. Memory Fragmentation wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww Each application in a Mac needs its own unbroken or contiguous block of memory. If you launch several applications and then quit some of them the memory is broken into separate parts — it’s fragmented. Even if there’s apparently enough memory to launch another application it won’t work unless there’s a large enough contiguous block. To overcome fragmented memory you may need to quit all of the most recently launched applications. Unless something’s gone horribly wrong you should be able to leave your very first application running! The amount of available contiguous memory appears as the Largest Unused Block in the About this Macintosh window, as shown below:-   Other applications such as Memory Mapper and Monitor can be used to provide a more comprehensive view of what’s happening to your memory. Some extensions let you to Quit the Finder, thus releasing fragmented memory without using a restart. If you’re using other extensions that add items to the menubar in the Finder this operation can make them disappear! Memory Symptoms wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww Memory problems are indicated by messages or odd behaviour:- “Not enough memory” Close other applications or adjust the memory assigned to the application. “The application ... has unexpectedly Quit (unknown error)” Something nasty! It’s advisable to select Restart or Shut Down. Hanging watch System stopping and starting Colours turning grey Problems with fonts Your system may be in trouble! It’s best to Restart or Shut Down. “Out of memory” “Address Error” “Bus Error” Bombs (25,28,33 or 35) Problems with fonts The system has run out of memory. It’s best to Restart or Shut Down. · The Disk Cache and RAM Disk use system memory (see below). “...Do you want to open SuperWriter using available memory?” Occurs when OtherMenu is installed and there’s inadequate memory to open an application with its preferred allocation. Take your choice! Avoiding Problems wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww To avoid memory fragmentation (see above) and other problems you should:- z Load important applications first. Smaller or less important ones can be loaded last. z Adjust the memory for each application using Get Info. If you’re handling very large documents you may need to allocate more space! z Quit applications, rather than just closing windows. z Press Option when opening an application to make the others quit. z Use Shut Down properly. z Avoid unnecessary extensions or control panels containing INITs. z Flush large items out of the Clipboard by copying any character twice. z If you have to force an application to quit with Shift-Option-Ç-Escape, you should immediately select Restart or Shut Down. z Save 100 K of memory by turning AppleTalk off in the Chooser. Reselect your printer in the Chooser after turning AppleTalk off and on again! z Save memory by turning File Sharing off in the Sharing Setup control panel. z Save memory by reducing the Cache in the Memory control panel (see below). The Memory Control Panel qqqqqqqqqqqqqqqqqqq   The Memory control panel determines how the system uses memory. Once you’ve modified a setting you must select Restart or Shut Down for changes take effect. Disk Cache wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww   This is a portion of RAM used as a software buffer for hard disk data. It holds recently used data, so speeding up the Mac and to minimising mechanical strain on the drive. The control panel (see below) sets the Cache size in 32 K steps up to a maximum of 256 K.   As a guide you should use the lowest possible Cache size — typically 32 K for every M of machine RAM — for example, 256 K for a memory of 8 M. Try different settings to see which uses your memory to best advantage. Non-Apple RAM Caches   If your hard disk is formatted with non-Apple software it may use its own cache — this may (or may not) use the Cache size setting in the Memory panel. Drives formatted with SpotOn can use its own intelligent cache. Since this replaces the Mac’s cache you should set the Cache size in the Memory panel to its minimum of 32 K. Speed Doubler employs the Speed Access intelligent cache that uses Cache size in the Memory panel — it’s value is set initially by Speed Doubler’s Installer. Virtual Memory wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww   VM increases the effective memory by using spare hard disk space — but it’s very slow on a 680x0 machine. On a PowerMac it actually speeds up application launching — always use it, perhaps set to 1 M more than your Mac’s RAM. If a Mac has a 4 M of RAM and you need 2 M of VM then 6 M of disk space must be set aside. To use VM first update the disk with Apple HD SC Setup or Drive Setup and then select Virtual Memory in the panel, as shown below:-   · Turn VM off if it disrupts digital audio recording and playback. · RAM Doubler 2 is far superior to VM and can triple your RAM capacity! It’s very good for running several applications at once but always avoid assigning an application any more memory than what’s in the physical RAM minus the system requirements. 24 and 32-bit Addressing wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww   System 7 can use 32-bit addressing which is theoretically capable of addressing 4 G of memory. In practice the processor also needs access to other devices, restricting capacity to 1 G. Older Macs use 24-bit addressing, with a range of 16 M, in reality limited to a maximum of 8 M, however much physical RAM is fitted. 32-bit addressing can be switched on or off in the panel, as shown below:-   · If 32-bit addressing isn’t enabled any physical RAM over 8 M appears in About This Macintosh as being used by the system! · Read Only Memory (ROM) in a Mac Plus, SE or Classic can’t support 32-bit addressing. · ROM in a Mac II, IIx, IIcx, or SE/30 isn’t 32-bit clean. Even with System 7 these machines can only use 8 M — unless you install MODE32 software from Connectix. · Some models have a physical RAM limitation — for example, a Performa 200 only takes 10 M of RAM. · Software produced before 1990 may not be 32-bit clean — you must update these applications before using 32-bit addressing. RAM Disk wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww   A RAM disk is a virtual disk, kept in memory, that acts as a disk drive with a minimum size of 416 K. If you perform a system update on a Mac with a smaller RAM disk it’ll be lost when the Mac’s restarted. It’s possible to use your Mac without any hard disk, but only if you’ve got up to 16 M of RAM to spare! You must first configure the RAM disk inside the the panel, as shown below:-   The RAM disk itself should include a minimal System, all necessary applications and the files you want to work on. · The RAM disk can be chosen as the startup disk in the Startup Disk control panel. · Some PowerBooks use battery-backed RAM disk — data is safe even after Shut Down. · With most Macs all RAM disk data is lost at Shut Down, but not after Restart. Parameter RAM qqqqqqqqqqqq   The Parameter RAM (PRAM) stores 256-bytes of data between startups, and is separate to normal RAM. A PCI PowerMac also uses a non-volatile RAM (NVRAM). 64 bytes are set aside to store parameters for the following control panels:- AppleTalk (or Network) Colour Date & Time Desktop Patterns General Controls Keyboard Memory Mouse Monitor (or Monitors & Sound) Screen Sound Startup Disk The PRAM also retains the configurations of modem and printer ports and which of these was last chosen for the printer. The remaining 192 bytes of PRAM are reserved for manufacture date and other factory settings — but are often used by other software. Settings for the Views control panel and Trash options aren’t kept in PRAM — they’re in the Finder Preferences file in the Preferences folder (in the System Folder). Zapping the PRAM wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww   The PRAM can be cleared or zapped by pressing Option-†-P-R during startup — keep holding the keys until the second startup message appears. This resets all parameters except the clock. You should only need to do this if:- z General Controls and other settings are lost z Desktop pattern reverts to default z Devices appear to be missing z Internal hard disk drive loses its icon z Clock or calendar fails z Speaker volume changes z Mouse speed and tracking changes to the slowest settings   Some experts say you should zap the PRAM at least three times, since all the data isn’t cleared in one go. Better still, you can use a PRAM utility such as TechTool. The last 192 bytes of PRAM, as described above, is cleared by TechTool but not by a normal zap. You may have to clear this extra area of PRAM if you have persistent problems! After a zap some control panel settings may default to:- z AppleTalk enabled z Colour set to black and white (1-bit) z Desktop Patterns set to a default pattern z Memory set to 24-bit addressing z Mouse set to Slow z Startup Disk set to the drive whose SCSI ID = 0 You can reset these panels or reload the settings from a file created with TechTool. Å The PRAM or NVRAM can hold a harmful virus. ©Ray White. All Rights Reserved 1997